<?php 
	include('languages.php');
	$trans = $lang[get_option('gahb_language')];
?>
<div class="wrap">
	<h2>Google Adsense and Hotel Booking - <?=$trans['0001']?>
		<span style="margin-left:50px;font-size:15px;">
			Language <select name="gahb_language" id="gahb_language">
						<option value="pt-br" <?php if (get_option('gahb_language')=='pt-br')echo "selected='selected'"; ?>>Português</option>
						<option value="en" <?php if (get_option('gahb_language')=='en')echo "selected='selected'"; ?>>English</option>
					</select>
		</span>
	</h2>
	<div class="postbox-container" style="width:49%;">
		<div class="metabox-holder">	
			<div class="meta-box-sortables">
			
				<!--Google Adsense Configurations-->
				
				<div id="" class="postbox">
					<div class="handlediv" title="Click to toggle">
						<div class="submit" id="ads_hide">
							<br/>
						</div>
						<div class="submit" id="ads_show">
							<br/>
						</div>
					</div>
					<h3 class="hndle" style="cursor:default;"><span><?=$trans['0002']?></span></h3>
					<div class="inside" id="gahb_ads">
						
						<div id="gahb_ads_cp" class="gray_box">
							<h4><?=$trans['0001']?></h4>
							<div class="inside">
								<table cellspacing="0">
									<tr>
										<td>
											<div class="field_label"><?=$trans['0003']?></div>
											<?php if(!get_option('gahb_ads_id')){ ?>
												<p class="explain alert rounded"><?=$trans['0004']?></p>
											<?php }else {?>
												<p class="explain"><?=$trans['0005']?></p>
											<?php } ?>
										</td>
										<td valign="top">
											<input type="text" size="40" name="gahb_ads_id" id="gahb_ads_id" value="<?=get_option('gahb_ads_id')?>"/>
										</td>
									</tr>
									<tr>
										<td>
											<div class="field_label"><?=$trans['0006']?></div>
											<p class="explain"><?=$trans['0007']?></p>
										</td>
										<td valign="top">
											<input type="text" size="40" name="gahb_ads_chanel" id="gahb_ads_chanel" value="<?=get_option('gahb_ads_chanel')?>"/> 
										</td>
									</tr>
								</table>
							</div>
						</div>
						<div style="text-align:right;margin-top:5px;">
							<span class="submit" id="gahb_form_save1_loader" style="display:none">
								<img src="/wp-admin/images/wpspin_light.gif"> <?=$trans['0008']?>...
							</span>
							<input class="button-primary" id="gahb_form_save1" type="button" value="<?=$trans['0009']?>" style="padding:1px 3px;"> 
						</div>
					</div>
				</div>	
						
				<!--OnlineHotel Configurations-->
				
				<div id="col1" class="postbox">
					<div class="handlediv" title="Click to toggle">
						<div class="submit" id="oh_hide">
							<br/>
						</div>
						<div class="submit" id="oh_show">
							<br/>
						</div>
					</div>
					<h3 class="hndle" style="cursor:default;"><span><?=$trans['0010']?> </span></h3>
					<div class="inside" id="gahb_oh">
						<?php if(!get_option('gahb_oh_api_key')){ ?>
								<form name="" id="" method="post" action="" >
									<table cellspacing="0" width="100%">
										<tr>
											<td align="center"><br/><br/>
												<?=$trans['0011']?>
												<br/><br/>
											</td>
										</tr>
										<tr>
											<td align="center"><br/><br/>
												 <input class="button-primary" type="button" onclick="window.location.reload();$(this).attr('disabled',true);$(this).attr('value','<?=$trans['0012']?>')" value="<?=$trans['0013']?>" style="padding:1px 3px;" />
												<br/><br/>
											</td>
										</tr>
										
									</table>
								</form>
						<?php }else { ?>
								<div id="gahb_oh_form_already">
									
									
									<div id="gahb_oh_cp" class="gray_box">
										<?php
											$stats = json_decode(get_option('gahb_oh_aff_stats'));
										?>
										<h4>
											<?=$trans['0014']?>
											<select id="gahb_oh_stats_period" name="gahb_oh_stats_period" style="margin-left:25px;">
												<option value="30" selected="selected">30 <?=$trans['0015']?></option>
												<option value="60" >60 <?=$trans['0015']?></option>
												<option value="90" >90 <?=$trans['0015']?></option>
											</select>
											<?php if($stats->convertions->total_convertions>0) {?>
											<div style="float:right;font-size:11px;font-weight:normal;"><?=$trans['0016']?>:<span id="gahb_oh_stats_convertions">R$ <?=$stats->convertions->total_to_pay?></span></div>
											<?php } ?>
										</h4>
										<div class="inside">
											<table cellpadding="0" cellspacing="0">
												<tr>
													<td style="text-align:center;"><?=$trans['0017']?></td>
													<td style="text-align:center;"><?=$trans['0018']?></td>
												</tr>
												<tr>
													<td style="text-align:center;">
														<div id="gahb_oh_stats_prints">
														<?php
															$total_prints = 0;
															if($stats->prints){
															foreach($stats->prints as $k=>$v){
																	$total_prints = $total_prints + $v;
															}
															}
															echo $total_prints;
														?>
														</div>
													</td>
													<td style="text-align:center;">
														<div id="gahb_oh_stats_clicks">
														<?php
															$total_clicks = 0;
															if($stats->clicks){
															foreach($stats->clicks as $k=>$v){
																	$total_clicks = $total_clicks + $v;
															}
															}
															echo $total_clicks;
														?>
														</div>
													</td>
												</tr>
											</table>
										</div>
									</div>
									
									<div id="gahb_oh_cp" class="gray_box">
										<form name="gahb_oh_form_general_settings" id="gahb_oh_form_general_settings" method="" action="">
										<h4><?=$trans['0019']?></h4>
										<div class="inside">
											<table cellspacing="0">
												<tr>
													<td>
														<div class="field_label"><?=$trans['0020']?></div>
														<p class="explain"><?=$trans['0021']?></p>
													</td>
													<td valign="top">
														<?=get_option('gahb_oh_api_key')?>
													</td>
												</tr>
												<tr>
													<td>
														<div class="field_label"><?=$trans['0022']?></div>
														<p class="explain"><?=$trans['0023']?></p>
													</td>
													<td valign="top">
														<input type="text" id="gahb_oh_paypal_account" name="gahb_oh_paypal_account" value="<?=get_option('gahb_oh_paypal_account')?>" size="40" />
													</td>
												</tr>
											</table>
										</div>
										</form>
									</div>
									<div id="gahb_oh_cp" class="gray_box">
										
									</div>
									<div style="text-align:right;padding:5px 3px 0px 0px;">
										<span class="submit" id="gahb_form_save2_loader" style="display:none">
											<img src="/wp-admin/images/wpspin_light.gif"> <?=$trans['0008']?>...
										</span>
										<input class="button-primary" type="button" value="<?=$trans['0009']?>" id="gahb_form_save2" style="padding:1px 3px;"> 
									</div>
								</div>
						<?php } ?>
					</div>
				</div>
				
			</div>
			<br/><br/><br/>
		</div>
	</div>
	<div class="postbox-container" style="width:50%;">
		<div class="metabox-holder">	
			<div class="meta-box-sortables">
			
				<!--Print Settings-->
			
				<div id="" class="postbox">
					<div class="handlediv" title="Click to toggle">
						<div class="submit" id="ads_hide">
							<br/>
						</div>
						<div class="submit" id="ads_show">
							<br/>
						</div>
					</div>
					<h3 class="hndle" style="cursor:default;"><span><?=$trans['0024']?></span></h3>
					<div class="inside" id="gahb_ads">
						
						<div id="gahb_ads_cp" class="gray_box">
							<form name="gahb_form_print_settings" id="gahb_form_print_settings" method="" action="">
							<?php
								$values = json_decode(get_option('gahb_print_settings'));
							?>
							<h4><?=$trans['0025']?></h4>
							<div class="inside">
								<table cellspacing="0">
									<tr>
										<td width="50%"><div class="field_label"><?=$trans['0026']?></div></td>
										<td>
											<select name="gahb_corner" id="gahb_corner">
												<option value="normal" <?php if($values->gahb_corner=='normal')echo "selected='selected'";?>><?=$trans['0027']?></option>
												<option value="rounded" <?php if($values->gahb_corner=='rounded')echo "selected='selected'";?>><?=$trans['0028']?></option>
											</select>
										</td>
									</tr>
									
									<tr>
										<td><div class="field_label"><?=$trans['0029']?></div>
											<p class="explain">
												<?=$trans['0030']?>
											</p>
										</td>
										<td>
											<table>
												<tr>
													<td>
														<INPUT TYPE=CHECKBOX NAME="gahb_c234x60" id="gahb_label_ai_234_60" class='gahb_checkbox' <?php if($values->gahb_c234x60=='on')echo "checked='checked'"; ?>><label for="gahb_label_ai_234_60">234x60</label><BR>
														<INPUT TYPE=CHECKBOX NAME="gahb_c468x60" id="gahb_label_ai_468_60" class='gahb_checkbox' <?php if($values->gahb_c468x60=='on')echo "checked='checked'"; ?>><label for="gahb_label_ai_468_60">468x60</label><BR>												
														<INPUT TYPE=CHECKBOX NAME="gahb_c728x90" id="gahb_label_ai_728_90" class='gahb_checkbox' <?php if($values->gahb_c728x90=='on')echo "checked='checked'"; ?>><label for="gahb_label_ai_728_90">728x90</label><BR>
													</td>
													<td>
														<INPUT TYPE=CHECKBOX NAME="gahb_c120x600" id="gahb_label_ai_120_600" class='gahb_checkbox' <?php if($values->gahb_c120x600=='on')echo "checked='checked'"; ?>><label for="gahb_label_ai_120_600">120x600</label><BR>
														<INPUT TYPE=CHECKBOX NAME="gahb_c160x600" id="gahb_label_ai_160_600" class='gahb_checkbox' <?php if($values->gahb_c160x600=='on')echo "checked='checked'"; ?>><label for="gahb_label_ai_160_600">160x600</label><BR>
														<INPUT TYPE=CHECKBOX NAME="gahb_c120x240" id="gahb_label_ai_120_240" class='gahb_checkbox' <?php if($values->gahb_c120x240=='on')echo "checked='checked'"; ?>><label for="gahb_label_ai_120_240">120x240</label><BR>
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td><div class="field_label"><?=$trans['0031']?> <input class="button" type="button" value="Restaurar valores" id="gahb_reset_colors" style="padding:1px 3px;"></div> 
											<p class="explain"></p>
											
										</td>
										<td >
											<table>
												<tr>
													<td><div class="field_label"><?=$trans['0032']?></div></td>
													<td>
														#<input type="text" name="gahb_border_color" id="gahb_border_color" size="6" value="<?=$values->gahb_border_color?>"/></td><td><div class="colorSelector" id="gahb_colorSelector1"><div style="background-color: #<?=$values->gahb_border_color?>"></div></div></td>
												</tr>
												<tr>
													<td><div class="field_label"><?=$trans['0033']?></div></td>
													<td>#<input type="text" name="gahb_background_color" id="gahb_background_color" size="6" value="<?=$values->gahb_background_color?>"/></td><td><div class="colorSelector" id="gahb_colorSelector2"><div style="background-color: #<?=$values->gahb_background_color?>"></div></div></td>
												</tr>
												<tr>
													<td><div class="field_label"><?=$trans['0034']?></div></td>
													<td>#<input type="text" name="gahb_link_color" id="gahb_link_color" size="6" value="<?=$values->gahb_link_color?>"/></td><td><div class="colorSelector" id="gahb_colorSelector3"><div style="background-color: #<?=$values->gahb_link_color?>"></div></div></td>
												</tr>
												<tr>
													<td><div class="field_label"><?=$trans['0035']?></div></td>
													<td>#<input type="text" name="gahb_text_color" id="gahb_text_color" size="6" value="<?=$values->gahb_text_color?>"/></td><td><div class="colorSelector" id="gahb_colorSelector4"><div style="background-color: #<?=$values->gahb_text_color?>"></div></div></td>
												</tr>
												<tr>
													<td><div class="field_label"><?=$trans['0036']?></div></td>
													<td>
														#<input type="text" name="gahb_url_color" id="gahb_url_color" size="6" value="<?=$values->gahb_url_color?>"/></td><td><div class="colorSelector" id="gahb_colorSelector5"><div style="background-color: #<?=$values->gahb_url_color?>"></div></div>
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<div class="field_label"><?=$trans['0037']?></div>
										</td>
										<td>
											<select name="ads_per_page" id="ads_per_page">
												<option value="0" <?php if($values->ads_per_page==0) echo "selected='selected'" ?>>0</option>
												<option value="1" <?php if($values->ads_per_page==1) echo "selected='selected'" ?>>1</option>
												<option value="2" <?php if($values->ads_per_page==2) echo "selected='selected'" ?>>2</option>
												<option value="3" <?php if($values->ads_per_page==3) echo "selected='selected'" ?>>3</option>
												<option value="4" <?php if($values->ads_per_page==4) echo "selected='selected'" ?>>4</option>
												<option value="5" <?php if($values->ads_per_page==5) echo "selected='selected'" ?>>5</option>
												<option value="6" <?php if($values->ads_per_page==6) echo "selected='selected'" ?>>6</option>
											</select>
										</td>
									</tr>
									<tr>
										<td>
											<div class="field_label"><?=$trans['0038']?></div>
										</td>
										<td>
											<select name="ads_per_post" id="ads_per_post">
												<option value="0" <?php if($values->ads_per_page==0) echo "selected='selected'" ?>>0</option>
												<option value="1" <?php if($values->ads_per_page==1) echo "selected='selected'" ?>>1</option>
												<option value="2" <?php if($values->ads_per_page==2) echo "selected='selected'" ?>>2</option>
												<option value="3" <?php if($values->ads_per_page==3) echo "selected='selected'" ?>>3</option>
												<option value="4" <?php if($values->ads_per_page==4) echo "selected='selected'" ?>>4</option>
												<option value="5" <?php if($values->ads_per_page==5) echo "selected='selected'" ?>>5</option>
												<option value="6" <?php if($values->ads_per_page==6) echo "selected='selected'" ?>>6</option>
											</select>
										</td>
									</tr>
									<tr>
										<td>
											<div class="field_label"><?=$trans['0039']?></div>
											<p class="explain"><?=$trans['0040']?></p>
										</td>
										<td valign="top">
											<table>
												<tr>
													<td>Google <input type="text" id="ads_percentage" name="ads_percentage" size="2" value="<?php if($values->ads_percentage) echo  $values->ads_percentage;?>"/>%</td>
													<td><?=$trans['0041']?> <input type="text" id="oh_percentage" name="oh_percentage" size="2" value="<?php if($values->oh_percentage) echo  $values->oh_percentage;?>"/>%</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td valign="top">
											<div class="field_label"><?=$trans['0042']?></div>
										</td>
										<td>
											<table>
												<tr>
													<td>
														Google
													</td>
													<td>
														<select name="ads_type_ads" id="ads_type_ads">
															<option value="text" <?php if($values->ads_type_ads=='text') echo "selected='selected'" ?>><?=$trans['0043']?></option>
															<option value="image" <?php if($values->ads_type_ads=='image') echo "selected='selected'" ?>><?=$trans['0044']?></option>
															<option value="text_image" <?php if($values->ads_type_ads=='text_image') echo "selected='selected'" ?>><?=$trans['0045']?></option>
														</select>
													</td>
												</tr>
												<tr>	
													<td>
														<?=$trans['0041']?>
													</td>
													<td>
														<select name="ads_type_oh" id="ads_type_oh">
															<option value="text" <?php if($values->ads_type_oh=='text') echo "selected='selected'" ?>><?=$trans['0043']?></option>
														</select>
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<div class="field_label"><?=$trans['0046']?></div>
										</td>
										<td>
											<select name="ads_positioning" id="ads_positioning">
												<option value="center" <?php if($values->ads_positioning == 'center') echo "selected='selected'" ?>><?=$trans['0047']?></option>
												<option value="left" <?php if($values->ads_positioning == 'left') echo "selected='selected'" ?>><?=$trans['0048']?></option>
												<option value="right" <?php if($values->ads_positioning == 'right') echo "selected='selected'" ?>><?=$trans['0049']?></option>
												<option value="top-center" <?php if($values->ads_positioning == 'top-center') echo "selected='selected'" ?>><?=$trans['0050']?></option>
												<option value="top-left" <?php if($values->ads_positioning == 'top-left') echo "selected='selected'" ?>><?=$trans['0051']?></option>
												<option value="top-right" <?php if($values->ads_positioning == 'top-right') echo "selected='selected'" ?>><?=$trans['0052']?></option>
												<option value="bottom-center" <?php if($values->ads_positioning == 'bottom-center') echo "selected='selected'" ?>><?=$trans['0053']?></option>
												<option value="bottom-left" <?php if($values->ads_positioning == 'bottom-left') echo "selected='selected'" ?>><?=$trans['0054']?></option>
												<option value="bottom-right" <?php if($values->ads_positioning == 'bottom-right') echo "selected='selected'" ?>><?=$trans['0055']?></option>
											</select>
										</td>
									</tr>
									<tr>
										<td>
											<div class="field_label"><?=$trans['0056']?></div>
										</td>
										<td>
											<input type="checkbox" name="non_show_home" id="non_show_home" <?php if($values->non_show_home=='on')echo "checked='checked'"; ?>/> <?=$trans['0057']?><br />
											<input type="checkbox" name="non_show_stats" id="non_show_stats" <?php if($values->non_show_stats=='on')echo "checked='checked'"; ?>/> <?=$trans['0058']?> <br />
											<input type="checkbox" name="non_show_posts" id="non_show_posts" <?php if($values->non_show_posts=='on')echo "checked='checked'"; ?>/> <?=$trans['0059']?> <br />
											<input type="checkbox" name="non_show_categories" id="non_show_categories" <?php if($values->non_show_categories=='on')echo "checked='checked'"; ?>/> <?=$trans['0060']?> <br />
											<input type="checkbox" name="non_show_archive" id="non_show_archive" <?php if($values->non_show_archive=='on')echo "checked='checked'"; ?>/> <?=$trans['0061']?> <br />
										</td>
									</tr>
									<tr>
										<td>
											<div class="field_label"><?=$trans['0062']?></div>
											<p class="explain"><?=$trans['0063']?></p>
										</td>
										<td valign="top">
											<input type="text" id="donation_percent" name="donation_percent" size="3" value="<?php if($values->donation_percent) echo  $values->donation_percent; else echo 0;?>"/> %
										</td>
									</tr>
								</table>
							</div>
							</form>
						</div>
						<div style="text-align:right;padding:5px 3px 0px 0px;">
							<span class="submit" id="gahb_form_save3_loader" style="display:none">
								<img src="/wp-admin/images/wpspin_light.gif"> <?=$trans['0008']?>...
							</span>
							<input class="button-primary" type="button" value="<?=$trans['0009']?>" id="gahb_form_save3" style="padding:1px 3px;"> 
						</div>
					</div>
				</div>
			</div>
			<br/><br/><br/>
		</div>
	</div>
</div>

<style>
	h4 span{font-size:11px;font-weight:normal;margin-left:50px;cursor:pointer;}
	.success{display:none; padding:2px 5px;border:1px solid #72CB67;background:#DFFAD3}
	.suggest,.alert{display:none; padding:2px 5px;border:1px solid #FFEF3F;background:#FFFAC6;margin-top:3px;line-height:18px !important;}
	.save_inline_btn{display:none;}
	.link_button{font-size:11px;color:#888;text-decoration:underline;cursor:pointer; margin-left:10px;}
	#gahb_oh, #gahb_ads{padding:5px;}
	#oh_hide,#oh_show,#ads_hide,#ads_show{cursor:pointer;}
	.explain{font-weight: normal;	font-size: 11px;	line-height: 12px;	color:#777; padding-left:5px; display:block !important;}
	.optional{font-weight: normal;	font-size: 11px;	line-height: 12px;	color:#777; padding-left:5px;}
	.separator{border-bottom:1px solid #fff;}
	.gray_box{background:#f9f9f9;	padding-left:3px; -moz-border-radius: 5px;	-webkit-border-radius: 5px;}
	.gray_box h4{padding:3px;	text-shadow:0 1px 0 #FFFFFF;	color:#666;}
	.gray_box table{width:99%;	border-top:1px solid #fff;	margin-top:5px;	padding-top:5px;-moz-box-shadow: 0px -1px 0px #ddd;	-webkit-box-shadow: 0px -1px 0px #ddd;}
	.gray_box table th{text-align:left;color:#666;font-size:12px;padding-bottom:3px;}
	.gray_box table td{text-align:left;color:#666;font-size:12px;padding:5px;}
	.colorSelector{float:right;}
	.gahb_oh_select_list{ margin:3px;color:blue;cursor:pointer;text-decoration:underline;}
	#gahb_oh_add_city_list{display:none;}
	.success .message_header, .alert .message_header{ padding:5px;font-weight:bold;}
	input[type="text"]{background:#EBF1FF !important;border:#A4C6D3 2px solid !important;color:#555555 !important; font-size:11px !important;}
	.field_label{color:#bf3d11; font-size:11px; font-weight:normal;}
	.gray_box table tr:hover{background:#f3f3f3;}
	.gray_box table td{margin:0px !important;}
	.rounded{-moz-border-radius: 5px;-webkit-border-radius: 5px;}
</style>